package com.ikun.service;

import java.time.LocalDate;
import java.time.LocalTime;
import java.util.List;
import java.util.Map;

import com.ikun.entity.Attendances;
import com.ikun.util.Result;

/**
 * 考勤表(Attendances)表服务接口
 *
 * @author Li
 * @since 2025-03-26 10:52:43
 */
public interface AttendancesService {

    Result clock_in(Integer staffId, LocalTime currentTime);

    Result clock_out(Integer staffId, LocalTime currentTime);

    Result insertStatus(Integer staffId, LocalDate recordDate, Integer status);

    // 根据员工ID和日期范围查询考勤记录
    Result<List<Attendances>> getAttendanceRecords(Map<String, Object> params);

    /**
     * 通过ID查询单条数据
     *
     * @param attendanceId 主键
     * @return 实例对象
     */
    Attendances queryById(Integer attendanceId);

    /**
     * 新增数据
     *
     * @param attendances 实例对象
     * @return 实例对象
     */
    Attendances insert(Attendances attendances);

    /**
     * 修改数据
     *
     * @param attendances 实例对象
     * @return 实例对象
     */
    Attendances update(Attendances attendances);

    /**
     * 通过主键删除数据
     *
     * @param attendanceId 主键
     * @return 是否成功
     */
    boolean deleteById(Integer attendanceId);

    int calculateAttendanceDays(String formattedYearMonth, String manageId);

    List<Attendances> findAllStuffAttendances(String datePart, String namePart);

    List<Attendances> getAllAttendance(Integer staffId);

    List<Attendances> allAttendances(String recordDate, String startTime, String endTime);
}
